<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>Forme</title>
        <script type="text/javascript">
          function getForm(rbrForme) {
              var polje = document.forms[0];
              var cb = document.getElementById("cb1");
              alert(polje.length);
              alert(polje.elements.length);
              alert(polje.action);
              if (cb.checked) {
                  alert("odabran");
              }
          }

          function showHide() {
              var cb = document.getElementById("cb1");
              var it1 = document.getElementById("it1");
              if (cb.checked) {
                  it1.style.visibility = "hidden";
              }
              else {
                  it1.style.visibility = "visible";
              }
          }

          function odabrano() {
              var c1 = document.getElementById("s1");
              var odabir = c1.selectedIndex;
              alert("Broj opcija: " + c1.options.length);
              alert("Odabrana opcija: " + c1.selectedIndex);
              alert("Odabrano: " + c1.options[odabir].value);
          }

          function provjera() {
              var it1 = document.getElementById("it1");
              if (it1.value) {
                  alert("OK");
                  return true;
              }
              else {
                  alert("No OK!");
                  return false;
              }
          }
        </script>
    </head>
    <body>
        <form name="f1" method="GET" action='http://www.google.com' onsubmit="return provjera();">
            <input id="it1" name="it1"/>
            <br/>
            <input id="it2" onclick="this.form.it1.value='asd'"/>
            <br/>
            <input type="checkbox" id="cb1" name="cb1" onchange="showHide();" checked="checked"/>
            <br/>
            <label for="yourname">Name</label>
            <input type="text" name="yourname" id="yourname"/>
            <br/>
            <select size="3" name="s1" id="s1">
                <option value="Kruske">Kruske</option>
                <option value="Jabuke" selected="selected">Jabuke</option>
                <option value="Lubenice">Lubenice</option>
            </select>
            <br/>
            <input type="button" name="b1" value="Click ME!" onclick="getForm(0)"/>
            <button type="button" onclick="odabrano();">Odabrano</button>
            <input type="submit"/>
        </form>
        <script type="text/javascript">        
 < /script>
    </body>
</html>